Ographe = Ember.Application.create({
  Version: "0.0.3",
  rootElement: '#Ograph',
  Resolver: Ember.DefaultResolver.extend({
    //Get hbs templates when needed
    //If template is included in index.html, this one will be used
    //otherwise, the template will be loaded from disk 
    resolveTemplate: function (parsedName) {
      var template = this._super(parsedName);
      var templateName = parsedName.fullNameWithoutType.replace(/\./g, '/');
      if (!template) {
        var filePath = 'js/template/' + templateName + '.hbs';

        console.log("Loading .hbs template: " + filePath);

        $.ajax({
          url: filePath,
          async: false,
          success: function (response) {
            template = Ember.Handlebars.compile(response);
          }
        });
      }
      return template;
    }
  })
});

